Skip to content

Add Astro Starlight links validator extension and fix broken documentation links - #758

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-5112b47c-b8b9-4c43-9ff1-5590bc6fb907
Sep 12, 2025
Merged

Add Astro Starlight links validator extension and fix broken documentation links#758
pelikhan merged 3 commits into
mainfrom
copilot/fix-5112b47c-b8b9-4c43-9ff1-5590bc6fb907

Conversation

Copilot AI commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

This PR addresses broken links in the documentation by implementing automated link validation using the starlight-links-validator plugin for Astro Starlight.

Problem

The documentation had several issues:

  • Missing alias-triggers.md file referenced throughout the docs
  • No automated link validation during build process
  • Potential for broken links to be introduced without detection

Solution

1. Added Starlight Links Validator Plugin

  • Installed starlight-links-validator@0.17.2 as a dependency
  • Configured the plugin in astro.config.mjs with appropriate settings:
    starlightLinksValidator({
      errorOnRelativeLinks: false,
      errorOnLocalLinks: false,
    })
  • This configuration allows Starlight's standard relative link format while catching genuinely broken links

2. Created Missing Documentation

Added comprehensive docs/src/content/docs/reference/alias-triggers.md covering:

  • @mention-style command triggers (/command-name syntax)
  • Context text access via ${{ needs.task.outputs.text }}
  • Visual feedback options with emoji reactions
  • Security considerations and permission model
  • Common use cases and examples
  • Integration with other trigger types

3. Enhanced Build Process

  • Added validate-links npm script for standalone link validation
  • Link validation now runs automatically during documentation builds
  • Build process fails with clear error messages when broken links are detected

Validation

The implementation successfully validates all documentation links:

  • ✅ All 17 documentation pages pass validation
  • ✅ Plugin correctly identifies broken absolute links while allowing valid relative links
  • ✅ No security vulnerabilities introduced (CodeQL clean)
  • ✅ All existing tests pass

Testing

The validator was tested to ensure it:

  1. Allows valid relative links (e.g., [text](file.md))
  2. Catches broken absolute links (e.g., [text](/missing/path/))
  3. Integrates properly with the Astro build pipeline
  4. Provides clear error reporting when issues are found

This ensures robust documentation link integrity going forward while maintaining the existing Starlight link conventions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3450889066/b278/cli.test -test.testlogfile=/tmp/go-build3450889066/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 12, 2025 03:06
…s.md documentation

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…validation

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Astro starlight links validator extension to docs, fix broken links in docs Add Astro Starlight links validator extension and fix broken documentation links Sep 12, 2025
Copilot AI requested a review from pelikhan September 12, 2025 03:14
@pelikhan
pelikhan marked this pull request as ready for review September 12, 2025 03:39
@pelikhan
pelikhan merged commit 2ad3de8 into main Sep 12, 2025
11 checks passed
@pelikhan
pelikhan deleted the copilot/fix-5112b47c-b8b9-4c43-9ff1-5590bc6fb907 branch September 12, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants